 //Maximum of 3 numbers

 # include <iostream.h>
 # include <conio.h>

 class MaxOf3 {
   int numbers[3];
 public:
   void getNumbers();
   void printMax();
 };

 void MaxOf3::getNumbers() {
   int i = 3;
   while(i) {
     cout << "Enter the number " << i << ": ";
     cin >> numbers[--i];
   }
 }

 void MaxOf3::printMax() {
   int max = numbers[2];
   int i = 2;
   while(i) {
     if(max < numbers[--i]) {
       max = numbers[i];
     }
   }
   cout << "Maximum is: " << max;
 }

 void main() {
   clrscr();
   MaxOf3 max3;
   max3.getNumbers();
   max3.printMax();
   getch();
 }